package jNotesCore;

import java.awt.Dimension;
import java.awt.Point;

public class Note 
{
	//TODO Change the comments into javadoc style for easy documentation. For an example see changeSize(Dimesion size)
	
	int ID = 0;
	
	int PositionX = 0;
	int PositionY = 0;
	
	Dimension Size = new Dimension(200, 12);
	
	int Parrent = -1;//Parent's ID
	int Children = -1;//Children's ID
	
	
	
	//Constructors
	
	public Note()//Create a default Note with the default Size and Position
	{
		
	}
	
	public Note(int PosX, int PosY)//Creates a note with the default size but a custom position.
	{
		PositionX = PosX;
		PositionY = PosY;
	}
	
	public Note(int PosX, int PosY, Dimension Sz, int id, int parrentID)//used for rebuilding saved notes
	{
		PositionX = PosX;
		PositionY = PosY;
		Size = Sz;
	}
	
	public Note(int PosX, int PosY, int SizeX, int SizeY, int id)//Used for manual entry of notes
	{
		PositionX = PosX;
		PositionY = PosY;
		Size = new Dimension(SizeX, SizeY);
	}
	
	public Note(int PosX, int PosY, int SizeX, int SizeY, int id, int parrentID)//Used for manual entry of notes
	{
		PositionX = PosX;
		PositionY = PosY;
		Size = new Dimension(SizeX, SizeY);
	}
	
	
	
	
	
	
	//Modifiers
	public void moveNote(int PosX, int PosY)//Reassign the notes position
	{
		PositionX = PosX;
		PositionY = PosY;
	}
	
	public void moveNote(Point Location)
	{
		PositionX = Location.x;
		PositionY = Location.y;
	}
	
	public void changeSize(int SizeX, int SizeY)//Change the Notes size by giving two integer values specifying the new dimensions in (x,y) format
	{
		Size = new Dimension(SizeX, SizeY);
	}
	
	/**
	 * Changes the notes size by giving their new Dimension as the argument
	 * @param size - new Dimension for the note.
	 */
	public void changeSize(Dimension size)
	{
		Size = size;
	}

	
	
	
	
	
	
	//Getters
	public int getPositionX() 
	{
		return PositionX;
	}

	public int getPositionY() 
	{
		return PositionY;
	}
	
	public Point getPosition()
	{
		return new Point(PositionX, PositionY);
	}
	
	public int getSizeX()
	{
		return Size.width;
	}
	
	public int getSizeY()
	{
		return Size.height;
	}

	public Dimension getSize() 
	{
		return Size;
	}
	
	public int getParrentID()
	{
		return Parrent;
	}
	
	public int getChildID()
	{
		return Children;
	}
	
	public int getID()
	{
		return ID;
	}
	
	public String toString()
	{
		return "The Note at position";
	}
	
	//empty individual properties. All the properties added to each note must have an empty replica here.
	
	public String getText()
	{
		return "";
	}
	
	
}
